﻿#ifndef YUTOPP_HATENA_AUTHENTICATOR_POLICY_HPP
#define YUTOPP_HATENA_AUTHENTICATOR_POLICY_HPP

#include "../../../oauth/1/core.hpp"
#include "../../../utility/translator_u8_sjis.hpp"

#include <string>
#include <utility>
#include <boost/optional.hpp>

namespace webapp
{
	namespace clients
	{
		namespace hatena
		{
			namespace policy
			{
				class authenticator
				{
				public:
					typedef std::string								string_type;
					typedef util::translator_u8_sjis				translator_type;

					typedef oauth::v1::core<>						auth_type;

					typedef std::pair<string_type, string_type>		request_token;
					typedef std::pair<string_type, string_type>		access_token;
					typedef boost::optional<request_token>			optional_request_token;
					typedef boost::optional<access_token>			optional_access_token;

					static const char* get_user_agent()
					{
						return "OAuthLibCpp";
					}

					static const char* get_domain()
					{
						return "www.hatena.com";
					}

					static const char* request_method()
					{
						return "POST";
					}
					static const char* request_path()
					{
						return "/oauth/initiate";
					}

					static const char* authorize_path()
					{
						return "/oauth/authorize";
					}

					static const char* access_method()
					{
						return "POST";
					}
					static const char* access_path()
					{
						return "/oauth/token";
					}
				};
			} // - policy
		} // - hatena
	} // - clients
} // - webapp

#endif /*YUTOPP_HATENA_AUTHENTICATOR_POLICY_HPP*/
